<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改教师的实验')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-teach-edit">
            <input name="id" th:field="${experimentDto.id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">实验名称：</label>
                <div class="col-sm-8">
                    <input name="experimentName" th:field="${experimentDto.experimentName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">课程名：</label>
                <div class="col-sm-8">
                    <input name="courseName" th:field="${experimentDto.courseName}" class="form-control" type="text" disabled>
                    <input name="courseId" th:filed="${experimentDto.courseId}" class="form-control" type="hidden">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">实验室节次：</label>
                <div class="col-sm-8">
                    <input name="section" th:value="'第'+${experimentDto.section}+'节'" class="form-control" type="text" disabled>
                    <input name="labDateId" th:field="${experimentDto.labDateId}" class="form-control" type="hidden" >
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-8">
                    <input name="userId" th:field="${experimentDto.userId}" class="form-control" type="hidden" >
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实验类型：</label>
                <div class="col-sm-8">
                    <select name="experimentType" class="form-control m-b">
                        <option value="0">虚拟仿真实验</option>
                        <option value="1">实物实验</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实验介绍：</label>
                <div class="col-sm-8">
                    <input name="experimentIntroduce" th:field="${experimentDto.experimentIntroduce}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">实验报告格式：</label>
                <div class="col-sm-8">
                    <input name="experimentShape" th:field="${experimentDto.experimentShape}" class="form-control" type="text">
                </div>
            </div>
        </form>
        <div style="float: right">
        <a class="btn btn-primary btn-rounded btn-sm" onclick="submitHandler()"><i class="fa fa-search"></i>&nbsp;保存</a>
        <a class="btn btn-warning btn-rounded btn-sm" onclick="$.modal.reload()"><i class="fa fa-refresh"></i>&nbsp;取消</a>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script type="text/javascript">
        var prefix = ctx + "buildexperiment";
        $("#form-teach-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/editList", $('#form-teach-edit').serialize());
            }
        }

        $("input[name='beginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>